﻿// Nail.WindowsContextMenu Library
// Nail framework
//
// Copyright © Frank Nagl, 2008-2011
// admin@franknagl.de
// www.franknagl.de
//
namespace ContextMenu
{
    using System.IO;
    using System.Windows.Forms;
    /// <summary>
    /// Creates a console application, which adds or removes the context 
    /// menu for 'Picturez' or 'SBIP'.
    /// </summary>
    public class Program
    {        
        static void Main(string[] args)
        {
            #region Picturez
            //string programExe =
            //    Directory.GetParent(
            //        Application.ExecutablePath) + "\\Picturez.exe";

            //if (args.Length != 0 && args[0] == "Remove")
            //{
            //    #region Altlasten von v1.0
            //    string[] formats = new[] { ".bmp", ".png", ".tiff", ".tif", 
            //        ".jpg", ".jpeg", ".wmf", ".emf", ".gif" };
            //    WindowsContextMenu.RemoveOldPicturezEntries(formats, "\\shell\\ConvertWithPicturez");
            //    WindowsContextMenu.RemoveOldPicturezEntries(formats, "\\shell\\EditWithPicturez");
            //    #endregion Ende Altlasten von v1.0
            //    WindowsContextMenu.RemovePicturezEntries();
            //    return;
            //}

            //// Deletes the old entries, if they still exist
            //#region Altlasten von v1.0
            //string[] formats2 = new[] { ".bmp", ".png", ".tiff", ".tif", 
            //        ".jpg", ".jpeg", ".wmf", ".emf", ".gif" };
            //WindowsContextMenu.RemoveOldPicturezEntries(formats2, "\\shell\\ConvertWithPicturez");
            //WindowsContextMenu.RemoveOldPicturezEntries(formats2, "\\shell\\EditWithPicturez");
            //#endregion Ende Altlasten von v1.0

            //WindowsContextMenu.AddPicturezEntries(programExe);
            #endregion Picturez

            #region SBIP
            //string programExe =
            //    Directory.GetParent(
            //        Application.ExecutablePath) + "\\SBIP.exe";

            //if (args.Length != 0 && args[0] == "Remove")
            //{
            //    WindowsContextMenu.RemoveSBIPEntries();
            //    return;
            //}

            //WindowsContextMenu.AddSBIPEntries(programExe);
            #endregion SBIP

            #region Serotonin
            string programExe =
                Directory.GetParent(
                    Application.ExecutablePath) + "\\Serotonin.exe";

            if (args.Length != 0 && args[0] == "Remove")
            {
                WindowsContextMenu.RemoveSerotoninEntries();
                return;
            }

            WindowsContextMenu.AddSerotoninEntries(programExe);
            #endregion Serotonin
        }
    }
}
